<!doctype html>
<html class="no-js">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>{$site.info_title} - 微信支付</title>

    <link rel="stylesheet" href="<?php echo ROOT_URL; ?>/public/common/css/amazeui.min.css">
    <link rel="stylesheet" href="<?php echo ROOT_URL; ?>/public/common/css/fix.css">
    <script type="text/javascript" src="<?php echo ROOT_URL; ?>/public/common/js/jquery.min.js"></script>
    <script type="text/javascript" src="<?php echo ROOT_URL; ?>/public/common/js/amazeui.js"></script>
    <script type="text/javascript" src="<?php echo ROOT_URL; ?>/public/common/js/do.js" data-cfg-autoload="false"></script>
    <script type="text/javascript" src="<?php echo ROOT_URL; ?>/public/common/js/package.js" data-path="<?php echo ROOT_URL; ?>/public/"
            data-role="<?php echo ROLE_NAME; ?>" data-root="<?php ROOT_URL; ?>"></script>
    <script type="text/javascript" src="<?php echo ROOT_URL; ?>/public/member/js/lib.js"></script>
</head>
<body>
<div class="uk-grid uk-margin-top">
    <div class="uk-width-2-3@m ">
        <div class="uk-card uk-card-default uk-card-small">
            <div class="uk-card-header">{$site.info_title} - 微信支付</div>
            <div class="uk-text-center">
                <p class="uk-padding-small">请打开微信扫码以下二维码支付</p>
                <div id="qrcode" class="uk-text-center"></div>
                <h1 class="uk-margin-top-xs">
                    <p>支付金额</p>
                    <span class="uk-text-danger">￥{$money}</span>
                </h1>
                <p>
                    <a class="" href="javascript:location.reload();">
                        支付成功后若无自动跳转请点击刷新
                    </a>
                </p>
                <br>
            </div>
        </div>
    </div>
</body>
<script>
    Do('base', 'qrcode', function () {
        $('#qrcode').qrcode({
            text: "{$code}",
            width: 200,
            height: 200
        });
        var refresh = function () {
            app.ajax({
                tip: false,
                url: '{url("status")}',
                type: 'post',
                data: {
                    order_no: '{$orderNo}'
                },
                success: function (info) {
                    window.location.reload();
                },
                error: function () {
                    setTimeout(function () {
                        refresh();
                    }, 3000);
                }
            });
        };
        refresh();
    });
</script>